package cn.tedu.myboot33.controller;

import cn.tedu.myboot33.entity.MyUser;
import cn.tedu.myboot33.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired(required = false)
    UserMapper mapper;

    @RequestMapping("/check")
    public String check(String username){
        MyUser user = mapper.check(username);
        if(user!=null){
            return "用户名存在!";
        }
        return "用户名可用!";
    }
}
